<include file="Public/header" /> 
<style>
	.color0{
		color:#f0ad4e;
	}
	.color1{
		color:#5cb85c;
	}
	.color-1{
		color:#d9534f;
	}
</style>
<!--主窗体-->
<div class="container app">
	<!--左侧菜单-->
	<include file="Public/sidebar" /> 
	<!--左侧菜单//-->
	
	<!-- mainCon -->
	<div id="mainCon" class="mainCon">
		<h4>会员素材</h4>
		<div>
		<form class="form-inline" method="get">
			<!-- <div class="form-group form-group-sm">
				<label for="">创建时间：</label>
				<input type="text" class="form-control laydate-icon" id="start_time" name="start_time"  value="<{$start_time?($start_time|date='Y-m-d H:i:s',###):''}>" >
				<span>-</span>
				<input type="text" class="form-control laydate-icon" id="end_time" name="end_time"  value="<{$end_time?($end_time|date='Y-m-d H:i:s',###):''}>" >
			</div> -->
			<div class="form-group form-group-sm">
				<label for="member_disable">状态：</label>
				<select id="status" name="status" class="form-control">
					<option value="all" <if condition="$status eq 'all'">selected</if>>全部</option>
					<option value="1" <if condition="$status eq '1'">selected</if>>审核通过</option>
					<option value="0" <if condition="$status eq '0'">selected</if>>审核</option>
					<option value="-1" <if condition="$status eq '-1'">selected</if>>审核不通过</option>
				</select>
			</div>
			<button type="submit" class="btn btn-default btn-sm">筛选</button>
		</form>
		</div>
		<div class="bk10"></div>
		<!-- <div>
			<a href="<{:U('Admin/ArticleSite/articleAdd',array('k'=>1,'sk'=>11))}>" class="btn btn-default">添加文章</a>
		</div> -->
		<div class="bk10"></div>
		<table class="table table-bordered table-hover">
			<tr>
				<th>id</th>
				<th>类型</th>
				<th>用户</th>
				<th>标题</th>
				<th>审核内容</th>
				<th>审核状态</th>
				<th>时间</th>
				<th>操作</th>
			</tr>

			<empty name="list">
				<tr><td colspan="8" style="text-align:center;color:#999">～暂无数据～</td></tr>
			<else /> 

				<foreach name="list" item="vo">
					<tr>
						<td><{$vo['id']}></td>
						<td><{$type_list[$vo['type']]}></td>
						<td><{$vo['mobile']}></td>
						<td><{$vo['title']}></td>
						<td>
							<if condition="$vo['type'] == '2'">
								<img width="100" height="100" src="/<{$vo['upload_address']}>">
							<else />
								<a href="<{$vo['upload_link']}>">查看链接</a>
							</if>
						</td>
						<td class="color<{$vo['is_pass']}>"><{$status_list[$vo['is_pass']]}></td>
						<td><{$vo['createtime']|date="Y-m-d H:i",###}></td>
						<td>
							<a href="<{:U('check_upload_material',array('id'=>$vo['id'],'k'=>10))}>">查看</a>
							<if condition ="$vo['is_pass'] != 1">
								<a href="javascript:void(0)" class="delAct" data-id="<{$vo['id']}>">删除</a>
							</if>
						</td>
					</tr>
				</foreach>
			
			</empty>
			
		</table>
		
		<div class="pagebar">
			<{$pager}>
		</div>
		
	</div>
	<!-- mainCon// -->
	
</div>
<!--主窗体//-->

<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>
$(function(){
	
	$(".delAct").click(function(){
	
		var that = this;
		var itemid = $(that).attr("data-id");
		
		layer.confirm('您确定删除此素材吗', {icon: 3, title:'提示'}, function(index){
			$.post("<{:U('do_material_delete')}>",{id:itemid},function(r){
				if(r.status != 1){
					layer.close(index);
					layer.alert(r.info,{icon: 2});
				}else{
					window.location.reload();
				}
			});
		});
		return false;
	});
	
	
	var start = {
		elem: '#start_time',
		format: 'YYYY/MM/DD',
		istime: true,
		istoday: false,
		choose: function(datas){
			 end.min = datas;
			 end.start = datas;
		}
	};
	var end = {
		elem: '#end_time',
		format: 'YYYY/MM/DD',
		istime: true,
		istoday: false,
		choose: function(datas){
			start.max = datas;
		}
	};
	laydate(start);
	laydate(end);
	
	
});
</script>

<include file="Public/footer" /> 